This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Adds new keywords for match statements#338
Open
BekaValentine wants to merge 1 commit intoatom:masterfrom
Open
Conversation
Author
|
I don't know enough about the testing library to properly implement tests for this, unfortunately. |
Author
|
@maxbrunsfeld would you be up for reviewing this? |
|
I tried your patch and currently everything looks good to me. Note: I disabled the built-in language-python 0.53.6 package and cloned language-python master branch (HEAD=fd71825) with your patch applied under .atom/packages directory. |
maxbrunsfeld
reviewed
Jun 3, 2022
| '"else"': 'keyword.control' | ||
| '"elif"': 'keyword.control' | ||
| '"match"': 'keyword.control' | ||
| '"case"': 'keyword.control' |
Contributor
There was a problem hiding this comment.
Do these work when Tree-sitter is enabled? I would think that the Tree-sitter parser would need to be upgraded to have the match and case keywords parsed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description of the Change
This PR adds keywords for the new match statements that were added to Python 3.10.
It does so by making them instances of 'keyword.control.conditional.python'.
Alternate Designs
One alternative option would be to have a separate type for the match statement keywords, however, match statements are arguably a flavor of conditional statement. For example,
is functionally the same as
Benefits
Python 3.10 will highlight correctly in Atom.
Possible Drawbacks
Code for previous versions of Python could have erroneous highlighting.
Applicable Issues
(#335)